<script setup lang="ts">
import logoUrl from "@@/assets/images/layouts/logo.png"
import { onBeforeMount, onMounted, ref, shallowReactive } from "vue"
import { articleDetailApi } from "@/api"
import { useUserStore } from "@/pinia/stores/user.ts"
import {removeToken} from "@@/utils/cache/cookies.ts";
const userStore = useUserStore()
const token = ref("")
const username = ref("")
const route = useRoute()
const detailData = ref({ id: "", title: "", content: "", desc: "" })
const images = ref<any[]>([])
onBeforeMount(() => {
  username.value = userStore.getUserName().value
  token.value = userStore.token
  // 组件已完成响应式状态设置，但未创建DOM节点
})
onMounted(() => {
  // getNewsOne()
})
function logout() {
  token.value = ""
  username.value = ""
  removeToken()
  userStore.setToken("") // token-admin
  userStore.setUsername("")
}
function getNewsOne() {
  // const data2 = { id: Number.parseInt(route.params.id) }
  // articleDetailApi(data2).then(({ data, code }) => {
  //   console.log(data)
  //   if (code === 0) {
  //     detailData.value.id = data.id
  //     detailData.value.title = data.title
  //     detailData.value.content = data.content
  //     detailData.value.desc = data.description
  //   }
  //   // list.value = Data
  // }).catch((data) => {
  //   console.log(data)
  // }).finally(() => {
  // })
}
// function onChange(swiper: any) {
//   console.log('slider change', swiper)
// }
// const effects = ['slide']
// const creativeEffects = [
//   {
//     prev: {
//       shadow: true,
//       translate: [0, 0, -400]
//     },
//     next: {
//       translate: ["100%", 0, 0]
//     }
//   }
// ]
const navigation = shallowReactive<{ [key: string]: any }>({})
function onBroadcastSwiper(swiper: any) {
  navigation.prevEl = swiper.navigation.prevEl
  navigation.prevEl.style.display = "none"
  navigation.nextEl = swiper.navigation.nextEl
  navigation.nextEl.style.display = "none"
}
</script>

<template>
  <div class="container_info">
    <div class="header">
      <div class="w-1200 header-content">
        <a href="/#/" class="logo"><img :src="logoUrl" width="47" height="47" /></a>
        <div class="nav">
          <ul>
            <li><a href="/#/ai">AI</a></li>
            <li class="active1">
              <a href="/#/info">资讯</a>
            </li>
            <li><a aria-current="page" href="/#/study" class="router-link-active router-link-exact-active">学习</a></li>
            <li><a href="/#/pms">PMS</a></li>
          </ul>
        </div>
        <div class="user">
          <div class="Login noLogin" v-if="token === ''">
            <a href="/#/login2" class="login">登录</a> |
            <a href="/#/register" class="register">注册</a>
          </div>
          <div class="Login" v-if="token !== ''">
            {{ username }}
            <a href="javascript:void(0)" @click="logout()">退出</a>
          </div>
        </div>
      </div>
    </div>
    <div class="module-container" >
      <div class="module-one" style="margin-top: 20px;  margin-bottom: 20px;" >
        <div style="font-size: 16px; font-weight: bolder;height: 40px; line-height: 40px; margin-top: 20px;  margin-bottom: 10px;" >
          {{ detailData.title }}原文卡 - 标题标题标题标题标题标题标题标题标题标题
        </div>
        <div style="text-indent: 20px;font-size: 15px;line-height: 28px;">
          <div style="text-indent: 20px;font-size: 15px;line-height: 28px;">
            原文卡 - 正文正文正文正文正文正文正文正文正文正文正文正文正文正文
          </div>
        </div>
        <div>
          评论
        </div>
      </div>
      <div class="info-content" >
        <div class="left" >
          <div class="list2-box" >
            <div class="item" >
              <div class="right scroll" >
                <a href="javascript:void(0)"  class="row1" >跨国公司高管为何密集访华？</a>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="module-two" >
        <div class="module-two-left" ></div>
        <div class="module-two-right" ></div>
      </div>
    </div>
    <div class="footer" >
      <div class="footer-content w-1200">
        <div class="footer-group">
          <h6>关于我们</h6>
          <p>公司介绍</p>
          <p>品牌故事</p>
          <p>设计团队</p>
        </div>
        <div class="footer-group">
          <h6>联系我们</h6>
          <p>电话020-28821862</p>
          <p>地址广州市越秀区东风东路836号</p>
        </div>
        <div class="footer-group">
          <h6>版权声明/隐私政策</h6>
          <p><a target="_blank" href="https://beian.miit.gov.cn/">粤ICP备2024234767号</a></p>
        </div>
        <div class="footer-group">
          <h6>扫二维码加入公众号了解更多</h6>
        </div>
      </div>
    </div>
  </div>
</template>

<style>
html,
body,
#app {
  height: 100%;
  margin: 0;
  padding: 0;
}
.el-carousel__item .carousel,
.el-carousel__item .carousel img {
  display: block;
  width: 100%;
  height: 100%;
}
.container_info {
  width: 100%;
  background: repeat center center / 100%;
}
.header {
  width: 100%;
  height: 64px;
  background: #fff;
}
.header .header-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.container_info .header .header-content .logo {
  width: 100px;
  height: 50px;
  line-height: 50px;
  padding: 0 10px;
}
.nav ul li:after {
  display: block;
  content: "";
  width: 50px;
  height: 4px;
  position: absolute;
  left: 50%;
  bottom: -5px;
  margin-left: -25px;
  border-radius: 2px;
}
.active1:after {
  background-color: #20d5a8;
}
.nav {
  width: 700px;
  display: flex;
  padding: 0 10px;
  flex-direction: row;
  height: 50px;
  color: #0e0e0e;
}
.nav ul {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}
.module-container {
  width: 65vw;
  margin: 0 auto;
}
.list1-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 0 32px;
}
.list1-box .item {
  width: 276px;
  height: 414px;
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
}
.list1-box .img1 {
  width: 244px;
  height: 122px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.list1-box .row1 {
  color: #333;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list1-box .row2 {
  color: #333;
  font-size: 18px;
  height: 184px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 7;
  line-height: 26px;
}
.list1-box .item {
  width: 276px;
  height: 414px;
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;}
.info-content {
  width: 100%;
}
.module-two {
  margin-bottom: 100px;
  display: flex;
  justify-content: space-between;
}
.footer .footer-content {
  width: 1520px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.info-content .right .check-box {
  margin-top: 24px;
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  display: flex;
  align-content: center;
  flex-wrap: wrap;
  gap: 24px 18px;
  font-size: 16px;
}
.user {
  width: 160px;
}
.info-content .right .check-box .el-checkbox {
  height: auto;
  margin-right: 0;
}
.info-content .right .hot-box {
  margin-top: 12px;
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  max-height: 400px;
  overflow-y: auto;
}
.info-content .right{
  width: 276px;
}
.info-content .left .list2-box .item{
  margin-bottom: 8px;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 207px;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  padding: 16px;
  box-sizing: border-box;
}
.info-content .left .list2-box .item .left .img1 {
  width: 176px;
  height: 100%;
  border-radius: 8px;
  margin-right: 16px;
}
.info-content .left .list2-box .item .left .center .row1 {
  font-family: Source Han Sans;
  font-size: 18px;
  font-weight: 500;
  color: #333;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 12px;
}
.info-content .left .list2-box .item .left .center .row2 {
  font-size: 14px;
  color: #666;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info-content .left .list2-box .item .left .center .row3 {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
}
.info-content .left .list2-box .item .left .center .row3 .text1 {
  font-size: 12px;
  color: #666;
  padding-right: 16px;
  margin-right: 16px;
  border-right: 1px solid #e0e0e0;
}
.info-content .left .list2-box .item .left .center .row3 .text1 {
  font-size: 12px;
  color: #666;
  padding-right: 16px;
  margin-right: 16px;
  border-right: 1px solid #e0e0e0;
}
.info-content .left .list2-box .item .left .center .row3 .text1:nth-last-child(1) {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}
.info-content .left .list2-box .item .left {
  flex: 1;
  display: flex;
  align-items: stretch;
}
.footer .footer-content {
  width: 1520px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.footer h6 {
  font-family: xiaomi;
  font-size: 14px;
  color: #000;
  line-height: 19px;
  margin-top: 31px;
}
.footer p {
  font-family: xiaomi;
  font-size: 14px;
  color: #000;
  line-height: 19px;
  margin-top: 13px;
  cursor: pointer;
}
.footer .footer-content {
  width: 1520px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.info-content .right .hot-box .row2 .text2 {
  flex: 1;
  font-size: 18px;
  color: #333;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list1-box .item {
  width: 276px;
  height: 414px;
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
}
.list1-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 0 32px;
}
.module-container {
  width: 65vw;
  margin: 0 auto;
}
.footer .footer-content {
  width: 1520px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.w-1200 {
  width: 80vw !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.footer .qcode img {
  display: block;
  width: 110px;
  height: 110px;
}
.footer .footer-content {
  width: 1520px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.footer {
  border-top: 2px solid rgba(0, 0, 0, .25);
}
.info-content .left .list2-box .item {
  margin-bottom: 8px;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 207px;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  padding: 16px;
  box-sizing: border-box;
}
.info-content .right {
  width: 276px;
}
.info-content .left .list2-box .item .right .row1 {
  font-size: 18px;
  font-weight: 500;
  color: #333;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info-content .left .list2-box .item .left .center {
  height: 100%;
  flex: 1;
  padding-right: 16px;
  margin-right: 16px;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}
.nav ul li.active1 a {
  color: #20d5a8;
}
.nav ul li a {
  font-family: xiaomi;
  font-size: 18px;
  color: #000;
  line-height: 24px;
  cursor: pointer;
  text-decoration: none;
}
.nav ul li:after {
  display: block;
  content: "";
  width: 50px;
  height: 4px;
  position: absolute;
  left: 50%;
  bottom: -5px;
  margin-left: -25px;
  border-radius: 2px;
}
.nav ul li {
  position: relative;
}
.isLogin .avatar-dropdown .avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.isLogin .avatar-dropdown .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 15px;
}
.isLogin .avatar-dropdown {
  display: flex;
  align-items: center;
  position: relative;
}
.isLogin .nikename {
  font-family: xiaomi;
  font-size: 18px;
  color: #000;
  line-height: 24px;
}
</style>
